vue2 jsx简单例子

vue2 jsx简单例子

 

<script>

export default {
  name: "swipermoban",
  data() {
    return {};
  },

  render(h) {
      console.log(h);
      return (<div>1111111</div>);
 },

 
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>

 

<script>
export default {
  name: "HelloWorld",
  props: {
    msg: String,
  },
  data() {
    return {
      xx: 31,
      xx1: '31',
    };
  },
  methods: {
    /**
    渲染子元素
    **/
    renderChild() {
      return <div>测33试</div>;
    },
  },
  render() {
    return <div xx={this.xx}>{this.xx}222</div>;
  },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>

 

posted @ 2022-06-04 10:50  newmiracle宇宙  阅读(118)  评论(0编辑  收藏  举报