Skip to content

demo.jsx:

js
import Vue from 'vue'
import Component from "vue-class-component";
import {Button} from 'iview'

@Component
export default class Demo extends Vue {
    show() {
        alert(123)
    }

    render() {
        return(
            <div style={{margin: '100px auto'}}>
                <div style="color: black; font-size: 18px; margin-bottom: 20px">我在vue中使用jsx</div>
                <Button on-click={this.show}>按钮</Button>
            </div>
        )
    }
}

运行:

image-20190507111029596

官方说明:

https://github.com/vuejs/jsx