import VueGist from './components/VueGist.vue'
export default {
name: 'vue-embed-gist',
props: ['gistId'],
render(h) {
return h(VueGist, {
props: {
gistId: this.gistId
}
})
}
}
view raw index.js hosted with ❤ by GitHub
import { mount } from 'vue-test-utils'
import VueEmbedGist from './'
test('it works', () => {
const wrapper = mount(VueEmbedGist)
expect(wrapper.isVueInstance()).toBe(true)
})
view raw index.test.js hosted with ❤ by GitHub
npm install --save vue-embed-gist
view raw npminstall.sh hosted with ❤ by GitHub
<template>
<vue-embed-gist
gist-id="your gist id"
file="your file name"/>
</template>
<script>
import VueEmbedGist from 'vue-embed-gist'
export default {
components: {
VueEmbedGist
}
}
</script>
view raw usage.vue hosted with ❤ by GitHub