index.vue

    1. <template >
    2. <div class="main">index</div>
    3. </template>
    4. <script type="text/ecmascript-6" src="./index.js"></script>
    5. <style lang="less" scoped>
    6. @import './index.less';
    7. </style>

    index.js

    1. /**
    2. *值得注意的是引入html、css、js分离的组件要加上.vue后缀名
    3. */
    4. //以下语句会引入componentA.js,会报错 template or render function not defined
    5. import componentA from './componentA';
    6. //正确
    7. import componentA from './componentA.vue';
    8. export default {
    9. name: 'index',
    10. components: {},
    11. data() {
    12. return {};
    13. },
    14. created() {},
    15. mounted() {},
    16. computed: {},
    17. methods: {
    18. init(type) {
    19. },
    20. },
    21. watch: {
    22. $route(to, from) {
    23. },
    24. },
    25. };

    index.less

    1. .main {
    2. height: 100%;
    3. width: 100%;
    4. }