index.vue
<template ><div class="main">index</div></template><script type="text/ecmascript-6" src="./index.js"></script><style lang="less" scoped>@import './index.less';</style>
index.js
/***值得注意的是引入html、css、js分离的组件要加上.vue后缀名*///以下语句会引入componentA.js,会报错 template or render function not definedimport componentA from './componentA';//正确import componentA from './componentA.vue';export default {name: 'index',components: {},data() {return {};},created() {},mounted() {},computed: {},methods: {init(type) {},},watch: {$route(to, from) {},},};
index.less
.main {height: 100%;width: 100%;}
