Get the App
SLTechnology News&Howtos  ›  Development  › 

The method of changing the parameters of Mini Program js file and updating it on view in time

Shulou Source: shulou.com Published: 2022-06-01 05:52:42 10月02日 Update

This article mainly introduces Mini Program js file to change parameters and update the view of the relevant knowledge, the contents of detailed easy to understand, simple and fast operation, with a certain reference value, I believe that after reading this Mini Program js file and the timely update of the method article will have a harvest, let's take a look at it.

1. Simple parameters

XX.wxml

{{str}} change XX.js Page ({data: {str:' good morning'}, change: function () {this.setData ({str: "good evening"})}) 2.Array of known subscript

Dns "> XX.wxml

{{array [0] .text}} change XX.js Page ({data: {array: [{text: 'good morning'}],}, change: function () {this.setData ({'array [0] .text': 'good evening')}) 3. Dynamic indexed array

XX.wxml

{{item.text}} change change XX.js

Page ({data: {array: [{text:'1111'}, {text:'2222'}, {text:'3333'}]}, change:function (e) {let param = {}; let string = "array [" + e.target.dataset.index+ "] .text; param [string] = '00000 targets holding this.setData (param)) }}) this is the end of the article on "how to change the parameters of Mini Program js files and update them on the view". Thank you for reading! I believe that you all have a certain understanding of the knowledge of "Mini Program js file change parameters and timely update on the view" knowledge, if you want to learn more knowledge, welcome to follow the industry information channel.

Tags: Parameters files methods programs views updates knowledge subscript content array good evening article value dynamic easy to operate article easy to understand more look industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Xiaomi vpn NVidia MariaDB