root methods is not a function when i refresh page
[issue link]I code a plugins as vue doc
import Vue from 'vue'
let MyPlugin = {}
MyPlugin.install = function (Vue, options) {
Vue.prototype.$myMethod = function (methodOptions) {
console.log(window)
}
}
Vue.use(MyPlugin)
this is my nuxt config
{
src: '~plugins/utils',
ssr: false
},
'~plugins/element-ui'
]
when i use $myMethod
module.exports = {
data () {
return {
text: 'lee'
}
},
created () {
console.log(this.$myMethod())
}
}
</script>
if i don’ t refresh this page the myMethod is not a function`
i console.log(this.$myMethod) i get this but i can’t use this function because this is not a function . hahahah~
ƒ (methodOptions) {
console.log(window);
}