首页 > 技术文章 > vue.js使用vue-preview做移动端缩略图时报错Property or method "$preview" is not defined

bill89 2019-03-08 16:45 原文

 

报错的详细信息为:

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),该插件已经更新,使用方法已经发生转变,所以要按照 该插件更新的使用方法来进行修改。

问题解决办法

1、按照github上的例子进行更改。(https://github.com/LS1231/vue-preview)

2、具体步骤如下图所示:

 

 

 

 

 

注意:这里的css一定要如上所示,单独写一个全局css文件并引用。

这样,就可以看到效果了。


 

https://blog.csdn.net/qq_36742720/article/details/83270636

推荐阅读