Comments (6)
Can you please an reproduction for this?
from create-vite-app.
import {
defineComponent,
Fragment,
} from 'vue'
export default defineComponent({
name: 'App',
setup() {
return () => <Fragment><div className="">test</div></Fragment>
},
})
Uncaught SyntaxError: Identifier 'Fragment' has already been declared
But, if remove the Fragment
import from 'vue', it worked.
import {
defineComponent,
Fragment, // remove this, it work.
} from 'vue'
from create-vite-app.
Or, just use <>
setup() {
return () => (
<>
<div className="">test</div>
</>
)
},
from create-vite-app.
What library do you used vue with jsx
? Look like it is their issues.
from create-vite-app.
{
"compilerOptions": {
"jsx": "preserve"
}
}
from create-vite-app.
Just use <></>
or () => [<div/>, <div/>]
. There's no point to import Fragment
if you are using JSX, that's intended.
from create-vite-app.
Related Issues (20)
- Feature Request: add template-vue-jsx-ts HOT 3
- npm init or npx will change .gitignore to .npmignore
- init template error HOT 3
- HMR not working with reason-react HOT 1
- [vue] valid template root HOT 3
- Feature Request: Preconfigured stuffs like vue-cli HOT 1
- Packages should be pre-installed HOT 1
- Provide options to merge or overwrite when creating vite-app in existing directory
- 1 command line instead for more faster create project , enter project, lanuch project . HOT 3
- react-ts template uses development bundle of React HOT 3
- can you add "template-vue-ts"? HOT 3
- How to config the default port 3000 to other port, like 8081? HOT 1
- Feature Request: how to customize my own template? HOT 2
- Add Typescript option during "npm init vite-app" like vue-cli HOT 2
- Ignore node_modules folder when compiling typescript
- Can't import vue in ts file.
- how to rename the output js and css file exists in __assets
- "require" is not defined when import a commonjs module HOT 2
- [vite] failed to load config from /Users/crazyair/Code/my-react-project/vite.config.js: HOT 1
- ts lint error when run 'npm run build'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from create-vite-app.