demo:optimize demo code

This commit is contained in:
pengfei.zhou
2020-01-06 10:43:18 +08:00
committed by osborn
parent 3b82935b24
commit 05b5c69080
25 changed files with 1860 additions and 1656 deletions

View File

@@ -1453,9 +1453,14 @@ function slideItem(item, config) {
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function scroller(content) {
function scroller(content, config) {
return (new Scroller).also(v => {
v.layoutConfig = layoutConfig().fit();
if (config) {
for (let key in config) {
Reflect.set(v, key, Reflect.get(config, key, config), v);
}
}
v.content = content;
});
}

View File

@@ -2901,9 +2901,14 @@ function slideItem(item, config) {
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function scroller(content) {
function scroller(content, config) {
return (new Scroller).also(v => {
v.layoutConfig = layoutConfig().fit();
if (config) {
for (let key in config) {
Reflect.set(v, key, Reflect.get(config, key, config), v);
}
}
v.content = content;
});
}