2017-04-12 158 views
0

我使用html-loader来编写我的vue组件。 例如: 从'vue'导入Vue;如何使用vue-hot-reload-api和vue-router没有vue-loader?

import template from './index.html'; 

export default { 
    template, 
    data() { 
     return { 

     }; 
    } 
}; 

在这种情况下,如何使用vue-hot-reload-api与vue-router没有vue-loader?
我不想将html,css和js合并成一个文件,我想单独编写它们。

回答

0

您可以用这种方法将这些文件分开:

<!-- my-component.vue --> 
<template src="./my-component.html"></template> 
<script src="./my-component.js"></script> 
<style src="./my-component.css"></style> 

来源:VueJS: What About Separation of Concerns?

相关问题