如何#!从url中删除hashbang ?
我找到了在vue路由器文档中禁用hashbang的选项(http://vuejs.github.io/vue-router/en/options.html)但是这个选项会删除#!并且只是放入#
有没有办法让干净的网址?
例:
不: #!/home
但: /home
嗨,我是Vue世界的新手,这是我得到的警告:成功方法已被弃用.请改用then方法.
以下是代码:
apiURL = 'api/movies';
new Vue({
el: '#app',
data: {
'movies': ''
},
ready: function() {
this.getMovies();
},
methods: {
getMovies: function() {
this.$http.get(apiURL, function(movies) {
this.$set('movies', movies);
});
}
}
});
Run Code Online (Sandbox Code Playgroud)
这也是做这种东西的正确方法吗?
嗨我发现这个错误: 未捕获(在承诺中)TypeError:这.$ set不是一个函数
以下是代码:
export default {
data: function() {
return { movies: '' }
},
ready: function() {
this.showMovies()
},
methods: {
showMovies: function() {
this.$http.get(config.api.url + '/movies').then(function (response) {
this.$set('movies', response.data)
})
}
}
}
Run Code Online (Sandbox Code Playgroud)