Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web:新增快捷工具插件,包括刷新和生成二维码 #1051

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@
"serve-handler": "^6.1.3"
},
"dependencies": {
"vant": "^3.1.0-beta.0",
"vue": "^3.2.21",
"@dokit/web": "file:packages/web",
"@dokit/web-core": "file:packages/core",
"@dokit/web-independent": "file:packages/web-independent",
"@dokit/web-utils": "file:packages/utils",
"@dokit/web": "file:packages/web",
"@dokit/web-independent": "file:packages/web-independent"
"qrcodejs2-fix": "^0.0.1",
"vant": "^3.1.0-beta.0",
"vue": "^3.2.21"
}
}
3 changes: 2 additions & 1 deletion Web/packages/web/src/feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ import HelloWorld from './components/ToolHelloWorld'
import Resource from './plugins/resources/index'
import ApiMock from './plugins/api-mock/index'
import WebVitals from './plugins/web-vitals-time/index'
import BasicTools from './plugins/basic-tools/index'

import {IndependPlugin, RouterPlugin} from '@dokit/web-core'

export const BasicFeatures = {
title: '常用工具',
list: [Console, AppInfo, Resource, Network, Storage, DemoPlugin, DemoIndependPlugin, H5DoorPlugin, WebVitals, Element, OneMachineWithMultipleControls, scanCode]
list: [Console, AppInfo, Resource, Network, Storage, DemoPlugin, DemoIndependPlugin, H5DoorPlugin, WebVitals, Element, OneMachineWithMultipleControls, scanCode,BasicTools]
// list: [Console, AppInfo, Resource, Network, Storage, H5DoorPlugin]
}

Expand Down
40 changes: 40 additions & 0 deletions Web/packages/web/src/plugins/basic-tools/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<template>
<div>
<div class="header">
<button @click="update()">刷新页面</button>
<button @click="creatQrCode()">生成二维码</button>
</div>
<div id="qrcode"></div>
</div>
</template>

<script>
import QRCode from 'qrcodejs2-fix'
export default {
data(){
return{
}
},
methods:{
update(){
location.reload()
},
creatQrCode() {
var qrcode = new QRCode(document.getElementById("qrcode"), {
text: ' http://localhost:3000', // 需要转换为二维码的内容
width: 100,
height: 100,
colorDark: '#000000',
colorLight: '#ffffff',
correctLevel: QRCode.CorrectLevel.H
})
},
},
}
</script>



<style scoped>

</style>
9 changes: 9 additions & 0 deletions Web/packages/web/src/plugins/basic-tools/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import BaiscTools from './app.vue'
import {RouterPlugin} from '@dokit/web-core'

export default new RouterPlugin({
nameZh: '快捷工具',
name: 'basic-tools',
icon: 'https://pt-starimg.didistatic.com/static/starimg/img/jvD7qcMXX51645432343946.png',
component:BaiscTools
})