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

vue3的模板中好像还不能使用3.2的setup语法糖 #7

Closed
xiaojingming opened this issue May 25, 2022 · 2 comments
Closed

vue3的模板中好像还不能使用3.2的setup语法糖 #7

xiaojingming opened this issue May 25, 2022 · 2 comments

Comments

@xiaojingming
Copy link

请问目前支持Vue3.2版本的setup语法糖吗?我看项目中Vue的版本已经是3.2.21了

@imgss
Copy link
Contributor

imgss commented May 25, 2022

vue面板是用parcel进行构建的,目前 parcel 2.5.0 还不支持<script setup>,但是PR已经合进去了parcel-bundler/parcel#8045 ,可以期待下,目前可以用的是下面的方式:

  import { reactive, computed } from "vue";

  export default {
    setup() {
      const state = reactive({
        count: 0,
        double: computed(() => state.count * 2),
      });

      function increment() {
        state.count++;
      }

      return {
        state,
        increment,
      };
    },
  };

@xiaojingming
Copy link
Author

谢谢😉

@imgss imgss closed this as completed in 6535f73 Jun 20, 2022
imgss added a commit that referenced this issue Jun 20, 2022
feat: 支持 script setup 语法,close #7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants