报错的详细信息为:

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、具体步骤如下图所示:

vue.js使用vue-preview做移动端缩略图时报错Property or method "$preview" is not defined

vue.js使用vue-preview做移动端缩略图时报错Property or method "$preview" is not defined

vue.js使用vue-preview做移动端缩略图时报错Property or method "$preview" is not defined

vue.js使用vue-preview做移动端缩略图时报错Property or method "$preview" is not defined

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

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

vue.js使用vue-preview做移动端缩略图时报错Property or method "$preview" is not defined

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
  • 2021-08-19
  • 2021-07-02
  • 2021-12-03
猜你喜欢
  • 2021-11-18
  • 2022-12-23
  • 2021-09-07
  • 2022-01-21
  • 2022-12-23
  • 2021-10-25
相关资源
相似解决方案