Vue.js 错误:未捕获类型错误:Vue.util.hyphenate不是函数
我正在尝试使用onsen ui设置vuejs,但出现以下错误: 错误:未捕获类型错误:Vue.util.hyphenate不是函数 以下是全部代码:Vue.js 错误:未捕获类型错误:Vue.util.hyphenate不是函数,vue.js,Vue.js,我正在尝试使用onsen ui设置vuejs,但出现以下错误: 错误:未捕获类型错误:Vue.util.hyphenate不是函数 以下是全部代码: <!DOCTYPE html> <html lang="en"> <head> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/onsen/2.1.0/css/onsenui.css"> <link
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/onsen/2.1.0/css/onsenui.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/onsen/2.1.0/css/onsen-css-components.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.2.1/vue.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/onsen/2.1.0/js/onsenui.js"> </script>
<script src="https://unpkg.com/vue-onsenui@2.0.0-alpha.0"></script>
</head>
<body>
<div id="app"></div>
</body>
<script>
var vm = new Vue({
el: '#app',
template:
'<v-ons-page>\
<v-ons-toolbar>\
<div class="center"> Title </div>\
</v-ons-toolbar>\
<p style="text-align: center">\
<v-ons-button @click="$notification.alert(\'Hello World!\')">Click</v-ons-button>\
</p>\
</v-ons-page>'
});
</script>
</html>
我找不到这是一个已知的问题。我还尝试了旧版本的ODVue,比如2.0.0
有人能帮忙吗?先生,我遇到了与您相同的错误,我试图找到错误并解决它。 首先,下载,并将脚本dom的src更改为本地的。 然后您可以打开vue-onsenui@2.0.0-alpha.0并查找以下代码: 变量寄存器=函数寄存器、类型、项{ 0,_keys2.defaultitems.forEachfunction键{ var值=项目[关键]; key=Vue.util.hyphenatekey; Vue[type]键,值; };
}; 在最新版本Vue.js中,Vue.util上的许多公开方法和属性已被删除 所以,您需要下载javascript文件并替换第67行中的代码: key=Vue.util.hyphenatekey;