feat:全局注入plus,customToast

master
zhoulei 3 years ago
parent 9cbb2fd062
commit 8bb9abbeae

@ -6,6 +6,7 @@ module.exports = {
extends: ['plugin:vue/essential', 'eslint:recommended', '@vue/typescript/recommended', '@vue/prettier', '@vue/prettier/@typescript-eslint'],
globals: {
uni: true,
plus: true,
},
parserOptions: {
ecmaVersion: 2020,

@ -87,7 +87,9 @@
"@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.0-29820201110001",
"@dcloudio/webpack-uni-mp-loader": "^2.0.0-29820201110001",
"@dcloudio/webpack-uni-pages-loader": "^2.0.0-29820201110001",
"@types/html5plus": "^1.0.2",
"@types/lodash": "^4.14.165",
"@types/uni-app": "^1.4.4",
"@typescript-eslint/eslint-plugin": "^4.9.0",
"@typescript-eslint/parser": "^4.9.0",
"@vue/cli-plugin-babel": "~4.5.0",

@ -1,7 +1,7 @@
/*
* @Author: zhou lei
* @Date: 2021-11-08 12:10:26
* @LastEditTime: 2022-01-21 09:16:58
* @LastEditTime: 2022-01-21 13:37:04
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/main.ts
@ -17,6 +17,7 @@ import { Alerts } from '@/components/alert/alert';
import filters from '@/utils/filter';
import plugins from '@/plugins';
import wybTable from '@/plugins/wyb-table/wyb-table.vue';
import MyMixins from './utils/mixin';
Vue.config.productionTip = false;
@ -28,6 +29,7 @@ Vue.use(Alerts);
Vue.use(filters);
// 引入插件组件
Vue.use(plugins);
Vue.mixin(MyMixins);
Vue.component('wyb-table', wybTable);
export default new App({

@ -87,12 +87,10 @@ import { BasePage } from '@/components/base/page';
import { VForm } from 'vue/types/form';
import { Lang } from '@/i18n';
// mixin
import MyMixins from '@/utils/mixin';
// import { any } from 'lodash/fp';
@Component({
components: { Alerts },
mixins: [MyMixins],
})
export default class LoginPage extends BasePage {
/**
@ -170,10 +168,8 @@ export default class LoginPage extends BasePage {
//uni.hideLoading();
if (downloadResult.statusCode == 200) {
//
// eslint-disable-next-line no-undef
plus.runtime.install(downloadResult.tempFilePath as any, { force: true }, function () {
//uni.showToast('');
// eslint-disable-next-line no-undef
plus.runtime.restart();
});
// uni.showModal({
@ -236,7 +232,6 @@ export default class LoginPage extends BasePage {
{},
function () {
console.log('安装文件成功!');
plus.runtime.restart();
},
function (e) {

@ -19,7 +19,8 @@
"webpack-env",
"@dcloudio/types",
"miniprogram-api-typings",
"mini-types"
"mini-types",
"@types/html5plus"
],
"paths": {
"@/*": [

@ -2,7 +2,7 @@
/*
* @Author: zhou lei
* @Date: 2022-01-21 09:23:56
* @LastEditTime: 2022-01-21 09:34:15
* @LastEditTime: 2022-01-21 11:47:17
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/types/vue-prototype.d.ts
@ -10,6 +10,7 @@
*/
import Vue from 'vue';
// 在 types/vue.d.ts 里 Vue 有构造函数类型
declare module 'vue/types/vue' {
interface Vue {
// $myProperty: string;

@ -1611,6 +1611,11 @@
dependencies:
"@types/node" "*"
"@types/html5plus@^1.0.2":
version "1.0.2"
resolved "https://registry.npmmirror.com/@types/html5plus/download/@types/html5plus-1.0.2.tgz#43e1aaca4584e7e2cf0db082389f42fbba98062c"
integrity sha1-Q+GqykWE5+LPDbCCOJ9C+7qYBiw=
"@types/http-proxy-middleware@*":
version "0.19.3"
resolved "https://registry.npm.taobao.org/@types/http-proxy-middleware/download/@types/http-proxy-middleware-0.19.3.tgz?cache=0&sync_timestamp=1605053627891&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fhttp-proxy-middleware%2Fdownload%2F%40types%2Fhttp-proxy-middleware-0.19.3.tgz#b2eb96fbc0f9ac7250b5d9c4c53aade049497d03"
@ -1737,6 +1742,13 @@
dependencies:
source-map "^0.6.1"
"@types/uni-app@^1.4.4":
version "1.4.4"
resolved "https://registry.npmmirror.com/@types/uni-app/download/@types/uni-app-1.4.4.tgz#fe73d0e7c89d5e750605e088ff6695846e019c36"
integrity sha1-/nPQ58idXnUGBeCI/2aVhG4BnDY=
dependencies:
vue "^2.6.8"
"@types/webpack-dev-server@^3.11.0":
version "3.11.1"
resolved "https://registry.npm.taobao.org/@types/webpack-dev-server/download/@types/webpack-dev-server-3.11.1.tgz?cache=0&sync_timestamp=1605057456418&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fwebpack-dev-server%2Fdownload%2F%40types%2Fwebpack-dev-server-3.11.1.tgz#f8f4dac1da226d530bd15a1d5dc34b23ba766ccb"
@ -11562,6 +11574,11 @@ vue@^2.6.11:
resolved "https://registry.npm.taobao.org/vue/download/vue-2.6.12.tgz?cache=0&sync_timestamp=1606321041576&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue%2Fdownload%2Fvue-2.6.12.tgz#f5ebd4fa6bd2869403e29a896aed4904456c9123"
integrity sha1-9evU+mvShpQD4pqJau1JBEVskSM=
vue@^2.6.8:
version "2.6.14"
resolved "https://registry.npmmirror.com/vue/download/vue-2.6.14.tgz#e51aa5250250d569a3fbad3a8a5a687d6036e235"
integrity sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ==
vuex-class@^0.3.2:
version "0.3.2"
resolved "https://registry.npm.taobao.org/vuex-class/download/vuex-class-0.3.2.tgz#c7e96a076c1682137d4d23a8dcfdc63f220e17a8"

Loading…
Cancel
Save