Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

uni-app 项目通过 unplugin-vue2-script-setup 插件使用 <script setup>,条件编译失效。 #152

Open
@shichaohui

Description

@shichaohui

Describe the bug

如下代码,wkv h5wkv not h5 两条日志都会打印出来。

<scriptsetup>  // #ifdef H5  console.log('wkv h5')  // #endif  // #ifndef H5  console.log('wkv not h5')  // #endif</script>

如下代码,运行报错Identifier 'a' has already been declared.

<scriptsetup>  // #ifdef H5  const a = 1  // #endif  // #ifndef H5  const a = 2  // #endif</script>

Reproduction

  1. 使用 vue-cli 创建 uni-app vue2 项目。 2. 安装并配置@vue/composition-apiunplugin-vue2-script-setup。 3. 添加上述代码并运行。

System Info

System:    OS: Windows 10 10.0.19044    CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz    Memory: 6.20 GB / 15.76 GB  Binaries:    Node: 16.5.0 - d:\Program Files\nodejs\node.EXE    Yarn: 1.22.19 - d:\Program Files\nodejs\yarn.CMD    npm: 7.19.1 - d:\Program Files\nodejs\npm.CMD  Browsers:    Edge: Spartan (44.19041.1266.0), Chromium (113.0.1774.35)    Internet Explorer: 11.0.19041.1566

Used Package Manager

pnpm

Validations

  • Follow ourCode of Conduct
  • Read theContributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is aminimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp