// vue vs react
<template>
//  对应 react 
 render() {
    return (
      <div>
        xxxxx
      </div>
    );
  }
  
</template>

<script>
	// 对应react 
	class Xxx extends React.Component { 
		xxxxxx
	}
	// 或者
	function Xxx() {
	xxxHooks
	  return (
	    <div>xxx</div>
	  );
	}
</script>

<style>
 // react 一般在同级目录新建 .css文件
</style>

 //  vs 数据更新
//  vue
this.data = xxx ;

// react
this.setState({
	xx:newXx
})
或Hooks
setHooks(xxxx)

// 其它生命周期个人感觉也差不多
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐