0
私はVue jsとMeteorを使って簡単なアプリを開発しています。私は非常に奇妙なエラーが発生します: '私の意見では、この種のエラーを与えるべきではないにもかかわらず、要素'ウィジェット ''を見つけることができません。私はすべてが働いていたことを言及する必要がありVue JS 2.0とMeteor JS
<head>
<title>vue-blaze</title>
</head>
<body>
<h1>Welcome to Meteor!</h1>
{{> vue_demo}}
</body>
<template name="vue_demo">
<div id="app">
</div>
</template>
Main.js
import { Template } from 'meteor/templating';
import { Session } from 'meteor/session';
import './main.html';
import {Vue} from 'meteor/akryum:vue';
import widget from '/imports/ui/Widget.vue';
//window.onload=function(){
var vm = new Vue({
el: '#widget',
render:h=>h(widget)
});
//}
Widget.vue
<template>
<div id="widget">
<div>Hello {{msg1}}!</div>
<input v-model="name" placeholder="Enter your name" />
</div>
</template>
<script>
import {Session} from 'meteor/session'
export default {
data() {
return {
msg1: 'Somebody'
}
}
}
</script>
<style scoped>
.widget {
background: #a0ddc4;
padding: 12px;
border-radius: 3px;
width: 300px;
border-bottom: solid 1px #40b883;
}
input {
display: block;
margin: 4px 0;
width: 100%;
box-sizing: border-box;
border: none;
padding: 6px 12px;
border-radius: 3px;
}
</style>
main.htmlと:これらは私のファイルですVue 2.0.3にアップデートする前に。
に
#app
を渡します:要素を見つけることができません:#app @VamsiKrishna – Roberto@Roberto '
'タグに全体の 'template'要素を配置します –私は、 bodyタグの中にmplateがあると、 "No such template:vue_demo"と表示されます。これはbodyタグの外側のテンプレートを検索するので意味があり、もう存在しません。しかし、 "要素#appを見つけることができません"というエラーは解決しません。 @ヴァムシクリシュナ – Roberto