? ????? WeChat ???? ??? ??? ?? ??? ?? ???? ??? ??? ?????. ???? js ????? ???? ??? ??? ??? ?? ? ??? ????.
??? ??? ????. WeChat ????? ?
?? ???? ????. ???-? ?????. view
? ??? ? ?
??? ?? ? scroll-view
? ?? ??? ??? ? ?? ????? ???. [?? ?? ?? : Mini Program Development Tutorialtab
切換頁面,tab
切換頁面有兩個內(nèi)容框,我是使用scroll-view
進行制作,然后在切換tab
頁面時,相應(yīng)的scroll-view
里的滾動條需要置頂處理?!鞠嚓P(guān)學(xué)習(xí)推薦:小程序開發(fā)教程】
我們可以看到官方文檔描述scroll-view
里有一個scroll-into-view
屬性,該屬性的描述如下
scroll-into-view的值應(yīng)為某子元素id(id不能以數(shù)字開頭)。設(shè)置哪個方向可滾動,則在哪個方向滾動到該元素
那么我們可以在這個屬性里大作文章,只要在scroll-view
里放置一個id值為設(shè)置的一個自定義值就可以實現(xiàn)切換tab
時,對應(yīng)的內(nèi)容框滾動條都自動滾到頂部,如下面代碼所示,下面代碼是我使用Taro
小程序框架演示的,原生的也同理。
import Taro from '@tarojs/taro' import { View } from '@tarojs/components' import { AtTabs, AtTabsPane } from 'taro-ui' export default class Index extends Taro.Component { constructor () { super(...arguments) this.state = { current: 0, } } handleClick (value) { this.setState({ current: value }) } render () { const tabList = [{ title: '標(biāo)簽第一頁' }, { title: '標(biāo)簽第二頁' }, { title: '標(biāo)簽第三頁' }] return ( <AtTabs current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}> <AtTabsPane current={this.state.current} index={0} > <ScrollView scrollY scrollIntoView='content-0'> <View id='content-0'></View> 標(biāo)簽頁一的內(nèi)容 </ScrollView> </AtTabsPane> <AtTabsPane current={this.state.current} index={1} > <ScrollView scrollY scrollIntoView='content-1'> <View id='content-1'></View> 標(biāo)簽頁二的內(nèi)容 </ScrollView> </AtTabsPane> <AtTabsPane current={this.state.current} index={2} > <ScrollView scrollY scrollIntoView='content-2'> <View id='content-2'></View> 標(biāo)簽頁三的內(nèi)容 </ScrollView> </AtTabsPane> </AtTabs> ) } }
如第一個tab
的scroll-view
里放置一個id值為content-0
的view
,那么在切換tab
頁時,scroll-view
會根據(jù)我們設(shè)置的scroll-into-view
]
?? ?? ??? ?? ? ???????- view
?? scroll-into-view
??? ????. ? ??? ?? ??? ??? ????
scroll-into-view? ?? ?? ?? ??(ID? ??? ? ??)? ?????. ???? ? ?? ??? ??? ?? ?? ???? ??? ?????? ?? ?? ? ??? ?? ??? ?? ? ????. scroll-view
? id ?? ???? ???. ?? ? ?? ???? ? ? ??? ?
? ???? ?? ??? ?? ??? ??? ???? ? ?? ?????? ?? ? ? ????. ?? ??? Taro
? ???? ????. ???? ?????? ?? ?????? ???? ?????.
<AtTabsPane current={this.state.current} index={0} > <ScrollView scrollY scrollIntoView='content-0'> <View id='content-0'></View> 標(biāo)簽頁一的內(nèi)容 </ScrollView> </AtTabsPane>???? ??, ? ??
?<? <code>scroll-view
? content-0
? ID ?? ?? ??</code? ?????. /code> >, <code>?
???? ??? ? scroll-view
? scroll-into-view
? ?? ?? ??? ID? ????. code> ??? ??on?? ???? ??? ??? ???? ?? ???? ??? ?? ? ????. ??<AtTabsPane current={this.state.current} index={0} > <ScrollView scrollY scrollIntoView='content-0'> 標(biāo)簽頁一的內(nèi)容 <View id='content-0'></View> </ScrollView> </AtTabsPane>??????? ??? ??? ?? ?? ??? ????? ?? ?? ?? ?? ?? ID? ?? ?? ??? ???? ???. ?? ?? ?? ?? ???????? ?? ??? ??? ???. ??rrreee??? ?? ????? ?? ??? ??? ??????? ?????? ?????! ! ??
? ??? ???????? ??? ??? ?? ???? ???? ??? ??? ?? ??? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??? ??? ????? ???? ?? WeChat? ???? ?? ???? ?? ??????? ?????. WeChat ?? ????? ???? ???? ??????? ?????? ???? ??? ?? ????? ?? ???? ? ?? ??? ?? ??? ??? ? ????. ? ????? Python? ???? WeChat ???? ???? ??? ?????. 1. ?? Python? ???? WeChat ???? ???? ?? ?? Python ?????? ???? ???. ???? wxpy? itchat ? ?????? ???? ?? ????. wxpy? ?? ?????

WeChat ?? ?????? ?? ??? ?? ?? WeChat ?? ?????? ?? ??? ??? ???? ?? ??? ??? ????? ?? ??? ??? ???? ? ?? ???? ????? ?????. ??? WeChat ????? ?? ??? ??? ???? ??? ??? ???? ?? ?? ??? ?????. ??, ?? ????? ??? ???? ??? ? ?? ?? ??? ???? ???. ??? ?? ??? ???? ?? ??? ?? ??? ?? ??? ???? ?? ????. <--index.wxml- ->&l

JavaScript?? ??? ?? ??? ????? ??? ???? ??? ?????? ? ????? ?? ?? ??? ???? ??? ????? ? ? JavaScript? ???? ??? ?? ??? ????? ??? ??? ? ????. ? ????? JavaScript? ?? ? ??? ???? ??? ???? ?? ?? ??? ?????. ??, ?? ??? ?? ??? ??? ???. Element.getBoundingClient? ??? ? ????.

10? 31? ? ???? ??? ??? ?? 5? 27? Ant Group? '?? ?? ????'? ????? ????? ?? ??? ??? ?????. Alipay? '?? ?? - ??? ?? ??' ?? ????? ??????. ?? ???? ?? ??? ?????? ???? ?? ???? ?? ??? ?? ??? ???? Alipay? ?? ??? ?? ??? ???? ? ??? ???. ?? ???? "????", "????" ?? ???? ???? "????" ???? ??? ? ????. ?? ?????? ???? ????? ?? ? ???? ?? ?? ??? ??? ??? ? ??? ?? ? Alipay ????? ?? ?????? ?? ??? ?????. ? ??????? ?? ??????? ?? ?? ?? ?? ??? ??? ? ??? ?????. ? ?? ??? ??? ???? ?? ??? ?? ???????. ??? ??

?? ????? ??? ??? ? ????. ?? ??: 1. "react-reconciler"? ???? ???? ???? DSL? ?????. 2. DSL? ?? ???? ????? ?? ?? ???? ?? ??? ????. 3. npm? ???? ???? ?????. ???? npm? ?????. 4. ??? ???? ???? ??? ?? API? ???? ??? ?????.

???? ?? ????? H5 ??? ??? ????? ???? ?? ??? ?????. ?? ??? ???? ??? ????? ???? ?? ?? ????? H5? ?? ?????? ??? ?????. ??? ??? ?? ?????? uniapp? ?? ??? ???? ?? ????? H5 ?? ??? ???? ???? ?? ???? ?? ???? ? ????. ? ????? uniapp? ?? ????? H5 ?? ??? ??? ???? ??? ???? ???? ?? ??? ?????. 1. ??? ??? ??

iframe? ???? ??????? ?? ?? ??? ?????. iframe ??? ???? ? ???? ?? ? ???? ??? ? ??? iframe? ???? ?? ? ?? ?? ??? ???? ???. ???? ?? ?? ? ??? ???? ??? ? ?? ??? ??? ? ??? iframe? ??? ???? ???? ????. ????? JavaScript? ???? iframe? ???? ?????? ??? ???? ??? ?? ?? ??? ?????. iframe ??? ????. ??, ??? ??? ?? ??

?? ?? ?? ?? ????? ??? ? ?? ??? ?? ????, ?? ?????? ?? ?? ??? ???? ???? ??? ?? ???????.
