mirror of
https://gitee.com/dcloud/uni-preset-vue
synced 2025-04-27 23:40:11 +08:00
chore: update @dcloudio/types version
This commit is contained in:
parent
40c19edac8
commit
e94c80c7d5
13
generator.js
13
generator.js
@ -46,7 +46,7 @@ module.exports = (api, options, rootOptions) => {
|
||||
devDependencies: {
|
||||
"@babel/runtime": "~7.17.9",// 临时指定版本,7.13.x 会报错
|
||||
'postcss-comment': '^2.0.0',
|
||||
'@dcloudio/types': '^2.6.7',
|
||||
'@dcloudio/types': '^3.0.4',
|
||||
'miniprogram-api-typings': '*',
|
||||
'mini-types': '*'
|
||||
},
|
||||
@ -94,6 +94,17 @@ module.exports = (api, options, rootOptions) => {
|
||||
} else if (template === 'default-ts') {
|
||||
await generate(path.resolve(__dirname, './template/common-ts'), files)
|
||||
await generate(path.resolve(__dirname, './template/default-ts'), files, base, rootOptions)
|
||||
|
||||
// default-ts 模板删除 jsconfig.json
|
||||
process.nextTick(() => {
|
||||
const folderPath = path.resolve(process.cwd(),rootOptions.projectName)
|
||||
const jsconfigPath = path.resolve(folderPath,'./jsconfig.json')
|
||||
const tsconfigPath = path.resolve(folderPath,'./tsconfig.json')
|
||||
|
||||
if(fs.existsSync(jsconfigPath) && fs.existsSync(tsconfigPath)){
|
||||
fs.unlinkSync(jsconfigPath)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const ora = require('ora')
|
||||
const home = require('user-home')
|
||||
|
11
template/common/sfc.d.ts
vendored
Normal file
11
template/common/sfc.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
declare module "vue/types/options" {
|
||||
type Hooks = App.AppInstance & Page.PageInstance;
|
||||
interface ComponentOptions<V extends Vue> extends Hooks {
|
||||
/**
|
||||
* 组件类型
|
||||
*/
|
||||
mpType?: string;
|
||||
}
|
||||
}
|
@ -8,7 +8,8 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import Vue from 'vue';
|
||||
|
||||
export default Vue.extend({
|
||||
data() {
|
||||
return {
|
||||
|
4
template/default-ts/sfc.d.ts
vendored
4
template/default-ts/sfc.d.ts
vendored
@ -1,4 +0,0 @@
|
||||
declare module "*.vue" {
|
||||
import Vue from 'vue'
|
||||
export default Vue
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user