4***@qq.com
4***@qq.com
  • 发布:2021-10-11 01:08
  • 更新:2021-10-11 01:08
  • 阅读:591

【报Bug】vue写法好像不支持

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: Linux 5.4 Ubuntu 20.04.3 LTS (Focal Fossa)

浏览器平台: Chrome

浏览器版本: Chrome: 80.0.3987.149

项目创建方式: CLI

CLI版本号: 4.5.13

示例代码:

运行环境的信息

System:
OS: Linux 5.4 Ubuntu 20.04.3 LTS (Focal Fossa)
CPU: (20) x64 Intel(R) Xeon(R) CPU E5-2660 v3 @ 2.60GHz
Binaries:
Node: 14.15.4 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.11 - /usr/local/bin/npm
Browsers:
Chrome: 80.0.3987.149
Firefox: 93.0
npmPackages:
@dcloudio/uni-app-plus-nvue: 0.0.1
@dcloudio/uni-app-plus-nvue-v8: 0.0.1
@dcloudio/uni-mp-vue: ^2.0.0-32220210818002 => 2.0.0-32920210927002
@dcloudio/vue-cli-plugin-hbuilderx: ^2.0.0-32220210818002 => 2.0.0-32920210927002
@dcloudio/vue-cli-plugin-uni: ^2.0.0-32220210818002 => 2.0.0-32920210927002
@dcloudio/vue-cli-plugin-uni-optimize: ^2.0.0-32220210818002 => 2.0.0-32920210927002
@dcloudio/webpack-uni-nvue-loader: 0.0.1
@hap-toolkit/dsl-vue: 0.6.13
@intlify/vue-devtools: undefined (9.1.7)
@vue/babel-helper-vue-jsx-merge-props: 1.2.1
@vue/babel-helper-vue-transform-on: 1.0.2
@vue/babel-plugin-jsx: 1.1.0
@vue/babel-plugin-transform-vue-jsx: 1.2.1
@vue/babel-preset-app: 4.5.13
@vue/babel-preset-jsx: 1.2.4
@vue/babel-sugar-composition-api-inject-h: 1.2.1
@vue/babel-sugar-composition-api-render-instance: 1.2.4
@vue/babel-sugar-functional-vue: 1.2.2
@vue/babel-sugar-inject-h: 1.2.2
@vue/babel-sugar-v-model: 1.2.3
@vue/babel-sugar-v-on: 1.2.3
@vue/cli-overlay: 4.5.13
@vue/cli-plugin-babel: ~4.5.0 => 4.5.13
@vue/cli-plugin-eslint: ~4.5.0 => 4.5.13
@vue/cli-plugin-router: 4.5.13
@vue/cli-plugin-typescript: ~4.5.0 => 4.5.13
@vue/cli-plugin-unit-jest: ~4.5.0 => 4.5.13
@vue/cli-plugin-vuex: 4.5.13
@vue/cli-service: ~4.5.0 => 4.5.13
@vue/cli-shared-utils: 4.5.13
@vue/compiler-core: 3.2.20
@vue/compiler-dom: 3.2.20
@vue/compiler-sfc: ^3.0.0 => 3.2.20
@vue/compiler-ssr: 3.2.20
@vue/component-compiler-utils: 3.2.2 (3.1.0)
@vue/devtools-api: 6.0.0-beta.19 (6.0.0-beta.15)
@vue/eslint-config-standard: ^5.1.2 => 5.1.2
@vue/eslint-config-typescript: ^5.0.2 => 5.1.0
@vue/preload-webpack-plugin: 1.1.2
@vue/reactivity: 3.2.20
@vue/ref-transform: 3.2.20
@vue/runtime-core: 3.2.20
@vue/runtime-dom: 3.2.20
@vue/server-renderer: 3.2.20
@vue/shared: ^3.0.0 => 3.2.20
@vue/test-utils: 1.0.0-beta.29 => 1.0.0-beta.29
@vue/web-component-wrapper: 1.3.0
jest-serializer-vue: 2.0.2
mpvue-page-factory: 1.0.1
mpvue-template-compiler: 1.0.13
typescript: ^3.0.0 => 3.9.10
uni-h5-vue: 2.6.10
uni-mp-vue: 2.6.10
vue: ^3.2.20 => 3.2.20
vue-eslint-parser: 7.11.0
vue-hot-reload-api: 2.3.4
vue-i18n: undefined (9.1.7)
vue-jest: 3.0.7
vue-loader: 15.9.8 (15.8.3, 16.8.1)
vue-router: 3.0.1
vue-style-loader: 4.1.3 (4.1.2)
vue-template-compiler: 2.6.14 (2.6.11)
vue-template-es2015-compiler: 1.9.1
vue-virtual-scroll-list: ^2.3.2 => 2.3.3
vue3: 1.0.0
vuex: ^4.0.0-0 => 4.0.2 (3.6.2)
vuex-module-decorators: ^1.0.1 => 1.0.1
npmGlobalPackages:
@vue/cli: 4.5.11

我的项目构建方式
vue create -p dcloudio/uni-preset-vue#vue3 aisonlin

main.ts的2.0写法,因为3.0写法会报错,我明明升级到v3 import Vue from 'vue' Vue打印出来还是v2的实例方法,所以无法导入createApp方法

import Vue from 'vue'
import App from './App.vue'
// @ts-ignore
const app = new Vue({
...App
})
app.$mount()

操作步骤:

vue create -p dcloudio/uni-preset-vue#vue3 aisonlin

import Vue from 'vue'

console.log(Vue)

打印结果 ƒ Vue (options) {

if ( true &&
!(this instanceof Vue)
) {
warn('Vue is a constructor and should be called with the new keyword');
}
this._init(options);
}

预期结果:

实现vue写法

实际结果:

vue写法好像不支持

bug描述:

vue写法好像不支持

2021-10-11 01:08 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复