我的文件夹结构是这样的:
./package.json
src/Notification.js
测试/通知.js
文件通知.js
export default {
template: '<div>{{message}}</div>',
data() {
return {
message: 'Hello world'
};
}
};
文件通知.js
import Vue from 'vue';
import test from 'ava';
import Notification from '../src/Notification';
test('that it renders a notification', t => {
new Vue(Notification).$mount();
});
我运行时出错:node_modules/.bin/ava
[Vue warn]: You are using the runtime-only build of Vue where the
template compiler is not available. Either pre-compile the templates
into render functions, or use the compiler-incluided build. (found in
<Root>)
1failed
that it renders a notification
test finished without running any assertions
如果有人能告诉我出了什么问题并解释代码,我将非常感激。