c5_labsci/fapp/ciyon_ap/pages/demo/case/vproject.vue

53 lines
1.6 KiB
Vue
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<ciy-header title="工程化改进"></ciy-header>
<view class="ciy-card">
<view class="title mk">
页面自动添加通用组件
</view>
<view class="right">template</view>
<view class="content">
<view>在vite.config.js中添加htmlPlugin_ciy plugins</view>
<view>在每个页面的template后添加通用组件</view>
<view>例如: ciy-authciy-alertciy-toastciy-popmenu等</view>
<!-- 修改vite工具
D:\Program Files\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\dist\utils\polyfill.js
在if (options?.filename) {下加入
if (options.filename.indexOf('/pages/') > -1)
source = source.replace('<template>','<template>\n<ciy-auth id="auth" ref="auth"></ciy-auth>'); -->
</view>
</view>
<view class="ciy-card">
<view class="title">自动生成pages.json路由</view>
<view class="content">
<view>将所有vue文件放入/pages/目录下</view>
<view>配置defpages.json只保留pages数组第一行</view>
<view>自建公用目录xx复制createpages.js</view>
<view>外部命令中添加ctrl+alt+p快捷键</view>
<view>[</view>
<view> "name":"Create Pages",</view>
<view> "command": ["node", "xx\createpages.js","$projectDir"],</view>
<view> "workingDir" : "xx\createpages",</view>
<view> "key": "ctrl+alt+p",</view>
<view> "type": "shell"</view>
<view>]</view>
</view>
</view>
</template>
<style>
</style>
<script>
export default {
data() {
return {
}
},
onLoad() {},
watch: {
},
computed: {
},
methods: {}
}
</script>