Skip to content

过滤掉jsx属性中的换行符 #308

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

2096903746
Copy link

  render (h) {
      return (
        <div style='
                line-height: 16px;
                text-align: left;
              '>
              </div>
    )}

以上jsx如果不过滤换行符,会报错: Unterminated string constant

在老版本jsx插件中, 是会过滤掉属性中的换行符,老版本参考:
[ babel-plugin-transform-vue-jsx
/index.js](https://github.com/vuejs/babel-plugin-transform-vue-jsx/blob/6ad7487579094cc188d470171af8f62335193896/index.js#L207)

jsx属性过滤换行符
@netlify
Copy link

netlify bot commented Jul 4, 2023

Deploy Preview for jsx-vue2-playground ready!

Name Link
🔨 Latest commit e3dd1dc
🔍 Latest deploy log https://app.netlify.com/sites/jsx-vue2-playground/deploys/64a400b7fd1cb90008f0ec1d
😎 Deploy Preview https://deploy-preview-308--jsx-vue2-playground.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant