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
430
202403-WebComponent
milkmidi
0
230
WebComponent
milkmidi
1
3.2k
前端好朋友-tailwindcss
milkmidi
0
8.7k
202110-federation
milkmidi
0
180
Vue3一次就上手
milkmidi
0
6.4k
Other Decks in Technology
See All in Technology
[しろおび夏祭り2026] チャットするAIから、作業するAIへ - 使われ方の変化と、その裏側で起きていること
kk0n
0
1.5k
20260801_スクフェス大阪
kgnkhkr
1
1.1k
最高のシステムプロンプトを作るためにフィードバック機能を導入した話
alchemy1115
1
320
AIエージェントの知識表現と推論に なぜグラフが使われるのか - 記号的AIの復権とニューラルAIとの統合
yohei1126
1
270
Digitization部 紹介資料
sansan33
PRO
2
7.7k
PLaMo 3.0 Primeの構造化出力サポート
pfn
PRO
0
180
歴史から理解するクラウドインフラのしくみ
kizawa2020
1
210
PLaMo 3.0 Primeの事後学習
pfn
PRO
0
270
AI駆動開発は個人技からチーム戦へ:組織でAIを使いこなすための実践設計
moongift
PRO
0
430
LangfuseによるLLMOps基盤の構築と活用事例
zozotech
PRO
1
260
toio・myCobotでフィジカルAIっぽいことを行うための検討(とりあえず調査) / フィジカルAI LT(IoTLTによる開催)
you
PRO
0
270
修正PRを食べてレビュースキルが賢くなる:Claude Codeによる自己改善サイクル
yuyaumetsu
0
400
Featured
See All Featured
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.5k
The Invisible Side of Design
smashingmag
301
52k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
330
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
920
sira's awesome portfolio website redesign presentation
elsirapls
0
310
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Agile that works and the tools we love
rasmusluckow
331
22k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
How to build a perfect <img>
jonoalderson
1
5.8k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
430
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