Skip to content

Commit 2c28db5

Browse files
committed
Add id for multiple use
1 parent 5b3cc75 commit 2c28db5

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module.exports = {
22
root: true,
33
parserOptions: {
4-
sourceType: 'browser',
54
sourceType: 'module',
65
},
76
extends: 'airbnb-base',

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ $ npm install vue-embed --save
1818

1919
```vue
2020
<template>
21-
<VEmbed :options="{ emoji: false }">
22-
<p>
23-
Lotus :smile: eleates vix attrahendams luna est.Advenas mori!Fermiums prarere in cubiculum!Cum cacula cantare, omnes stellaes manifestum azureus, nobilis https://vuejs.org/ acipenseres.Cum orgia mori, omnes rationees <3 experientia alter, regius :heart: mortemes.Devatios persuadere, tanquam secundus spatii.Heu, barcas!Cedriums observare!A falsis, lacta talis imber. :P Cur eleates peregrinatione?
24-
</p>
21+
<VEmbed :id="gist" :options="{ emoji: true }">
22+
<p>https://gist.github.com/yyx990803/7cfec746bb8cd6ae05e72f30104c0d51</p>
2523
</VEmbed>
2624
</template>
2725
@@ -35,14 +33,12 @@ export default {
3533
}
3634
</script>
3735
```
38-
---------------
3936

40-
[Embed.js Documentation](https://embedjs.readme.io/)
37+
You also need to import the embed css file :
38+
```html
39+
<link href="https://cdn.jsdelivr.net/embed.js/4.0.0/embed.min.css" media="all" rel="stylesheet">
40+
```
4141

4242
---------------
4343

44-
Todo:
45-
46-
- [ ] Add embed css
47-
- [ ] Add examples
48-
- [ ] Publish to NPM
44+
[Embed.js Documentation](https://embedjs.readme.io/)

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
"keywords": [
1616
"vue",
1717
"vue-embed",
18+
"plugins",
19+
"emoji",
20+
"emoticon",
1821
"embed.js",
1922
"embed",
2023
"javascript",

src/VEmbed.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div id="embed--container">
2+
<div :id="id">
33
<slot></slot>
44
</div>
55
</template>
@@ -8,6 +8,10 @@ import EmbedJS from 'embed-js';
88
99
export default {
1010
props: {
11+
id: {
12+
type: String,
13+
default: 'embed__container',
14+
},
1115
options: {
1216
type: Object,
1317
default: () => ({}),
@@ -24,7 +28,7 @@ export default {
2428
EmbedJS.setOptions(this.options);
2529
2630
this.vEmbed = new EmbedJS({
27-
input: document.querySelector('#embed--container'),
31+
input: document.querySelector(`#${this.id}`),
2832
});
2933
3034
this.vEmbed.render();

0 commit comments

Comments
 (0)