Skip to content

Instantly share code, notes, and snippets.

@smg99
Created August 9, 2021 05:28
Show Gist options
  • Save smg99/05972bb26a48287dd719255977491b8f to your computer and use it in GitHub Desktop.
Save smg99/05972bb26a48287dd719255977491b8f to your computer and use it in GitHub Desktop.
Vue.js - Split single file component into multiple files
export {default} from './todo.vue'
<div>
<!-- HTML for todo component -->
</div>
export default{
name: 'todo',
template: "#todo-template",
props: ["prop1", "prop2"],
data: function(){
return {
}
},
methods:{
method1(){
}
}
}
/*sass styling for todo component*/
<style src="./todo.sass" lang="sass"></style>
<template src="./todo.html" id="todo-template"></template>
<script src="./todo.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment