cordova vue 悬浮窗提示

cordova 项目中

cordova plugin add cordova-plugin-x-toast
cordova vue 悬浮窗提示_第1张图片

vue项目中引入

引入Toast.js

cordova vue 悬浮窗提示_第2张图片

index.html 中


![在这里插入图片描述](https://img-blog.csdnimg.cn/20200410161222174.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM2MTIwMzQy,size_16,color_FFFFFF,t_70)

vue项目中使用

 window.plugins.toast.showWithOptions(
      {
        message: message,
        duration: "2000", // which is 2000 ms. "long" is 4000. Or specify the nr of ms yourself.
        position: "top",
        addPixelsY: 0 // added a negative value to move it up a bit (default 0)
      },
      function(args) {
        console.log("toast args: ", args.event);
        //This will print 'hide'
      },
      function(error) {
        console.error("toast error: ", error);
      }
    );

打包使用

效果图
cordova vue 悬浮窗提示_第3张图片

你可能感兴趣的:(vue,打包部署)