Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vue.js 错误:未捕获类型错误:Vue.util.hyphenate不是函数_Vue.js - Fatal编程技术网

Vue.js 错误:未捕获类型错误: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

我正在尝试使用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 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;