Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
202007-React對戰雷台
Search
milkmidi
July 29, 2020
Technology
200
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
202007-React對戰雷台
202007 五倍紅寶石 Vue React對戰雷台
milkmidi
July 29, 2020
More Decks by milkmidi
See All by milkmidi
202512-WebConfig 大 AI 時代,工程師的成長之路
milkmidi
0
440
202403-WebComponent
milkmidi
0
230
WebComponent
milkmidi
1
3.2k
前端好朋友-tailwindcss
milkmidi
0
8.7k
202110-federation
milkmidi
0
190
Vue3一次就上手
milkmidi
0
6.4k
Other Decks in Technology
See All in Technology
国家プロジェクトを支える「さくらONE」 大規模LLM開発におけるGPU障害を乗り越えるクラスター運用戦略
gpuunite_official
0
290
Data Hubグループ 紹介資料
sansan33
PRO
0
3.2k
8bit CPU 2026
koba789
7
2.9k
Bill One 開発エンジニア 紹介資料
sansan33
PRO
7
20k
IHV like なユースケースへのOpenID Connect 関連仕様の適用事例
optim
0
290
Windows の互換機能 - 古いプログラムはなぜ動作できるのか
murachiakira
PRO
0
110
AIに持続⼒を与える 判断の⻑期記憶設計
eiei114
1
720
【書籍出版記念】 10周回って、エージェント開発は RAGがすべてだった。〜RAGの歴史と開発現場で見えた実践知〜
akiratameto
20
7.6k
AI for Science時代を切り開く、政府の次世代HPC戦略の展望
gpuunite_official
0
260
[ホンマでっか SRE] あなたはなぜ SRE に?
_awache
0
260
Oracle MCP Servers Explained
thatjeffsmith
1
510
RelayerというPHPのフレームワークを作った
polidog
PRO
0
140
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
820
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
360
How GitHub (no longer) Works
holman
316
150k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
510
How to Think Like a Performance Engineer
csswizardry
28
2.7k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3k
Between Models and Reality
mayunak
4
410
What's in a price? How to price your products and services
michaelherold
247
13k
Automating Front-end Workflow
addyosmani
1369
210k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Building the Perfect Custom Keyboard
takai
2
850
Transcript
None
None
None
None
None
None
None
None
None
None
None
None
None
None
App.vue <template> <div id="app"> <input type="text" v-model="name"> <button @click="atClickHandler($event)">Click</button> <MyComponent
foo.sync="foo" /> </div> </template>
None
App.vue <script> export default { name: 'iDontlikeCodeReviewVue', props: { lists:
{ type: Array } }, }; </script> <template> <div id="app"> <template v-if="lists?.length > 0"> <section v-for="o in lists"> <ul v-if="o.active"> <li v-for="o2 in lists.books"> <h1 v-if="o2.tag === ‘h1’">hi</h1> <a>{{o2.name}}</a> </li> </ul> </section> </template> </div> </template> App.jsx var InnerSection = (props) => { var { books, active } = props; if (!active) { return null; } return ( <ul> { books.map((item) => (<li><a>{item.name}</a></li>)) } </ul> ) } const IloveReact = (props)=> { var { lists } = props; if (lists?.length === 0) { return null; } return ( <div> { lists.map((list) => <InnerSection {...list} />) } </div> ) }
None
type BookType = { name: string; } type ListType =
{ active: boolean; books: BookType[]; } var InnerSection = (props:ListType) => { var { books, active } = props; if (!active) { return null; } return ( <ul> { books.map((item:BookType) => (<li><a>{item.name}</></li>)) } </ul> ) } interface Props { lists: ListType[] } const IloveReact = (props:Props)=> { var { lists } = props; if (lists?.length === 0) { return null; } return ( <div> { lists.map((list:ListType) => <InnerSection {...list} />) } </div> ) } typescript, flowjs
App.vue <script> export default { // // ... // methods:{
foo(){ // name data ? // porps ? this.name; // methods ? // vuex ? this.maybeCallFromVuex(‘ ?’); } } }; </script> App.jsx interface Props { onCallParent: (name:string)=> void; } interface State { name: string; } class LoveReact extends React.Component<Props, State> { componentDidMount(){ this.props.onCallParent(this.state.name); } }
App.vue <template lang="pug"> .row .col-xs-12.center ul.pagination li(v-bind:class="page<=1 ? 'disabled': ''")
template(v-if="page>1") a(href='' @click.prevent='prevPage') Previous template(v-else) a Previous template(v-for='(item, index) in pagenations’) li(v-bind:class="page===item ? 'active': ‘’” v-bind:key="item+'_'+Math.floor(Math.random()*9527)") a(href='' @click.prevent='gotoPage(item)’ v-bind:key="item+'_'+Math.floor(Math.random()*9527)") {{item}} li(v-bind:class="page>=totalpage ? 'disabled': ‘’”) template(v-if="page<totalpage") a(href='' @click.prevent='nextPage') Next template(v-else) a Next </template>
None
None
None
None
None
None
None
None
None
None
None