1. 程式人生 > >vue.js使用vue-preview做移動端縮圖時報錯Property or method "$preview" is not defined

vue.js使用vue-preview做移動端縮圖時報錯Property or method "$preview" is not defined

報錯的詳細資訊為:

Property or method "$preview" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property

在全域性已經引入和安裝該外掛的前提下,檢視github中該外掛得知(地址:https://github.com/LS1231/vue-preview

),該外掛已經更新,使用方法已經發生轉變,所以要按照 該外掛更新的使用方法來進行修改。

問題解決辦法

2、具體步驟如下圖所示:

注意:這裡的css一定要如上所示,單獨寫一個全域性css檔案並引用。

這樣,就可以看到效果了。