feat: add copy demo

This commit is contained in:
Burt 2024-01-24 10:38:16 +08:00
parent 9a7aa81234
commit 7e232483f2
2 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,29 @@
<route lang="json5" type="page">
{
style: { navigationBarTitleText: '复制' },
}
</route>
<template>
<view class="">
<button @click="onCopy">复制</button>
</view>
</template>
<script lang="ts" setup>
const onCopy = () => {
uni.setClipboardData({
data: '菲鸽,你最棒',
fail: (fail) => {
console.error('fail', fail)
},
success: (success) => {
console.log('success', success)
},
})
}
</script>
<style lang="scss" scoped>
//
</style>

View File

@ -30,7 +30,7 @@ import { visualizer } from 'rollup-plugin-visualizer'
// https://vitejs.dev/config/
export default ({ command, mode }) => {
console.log(mode === process.env.NODE_ENV)
// console.log(mode === process.env.NODE_ENV) // true
// mode: 区分生产环境还是开发环境
console.log(command, mode)