I think properties is written in the same way except for a few more parameters. What is the specific difference between the two? why should it be divided into two?
I think properties is written in the same way except for a few more parameters. What is the specific difference between the two? why should it be divided into two?
do you mean properties
and data
of the component?
properties
is a parameter that can be passed externally when using a component, that is, the caller can modify the property externally, but not if it is placed in data
.
for example, if there is a component called titleContainer
, there is a title
attribute in properties
:
//...
properties: {
title: {
type: String,
value: 'default title',
}
}
//...
use components in the page:
<titleContainer title="{{otherTitle}}"></titleContainer>
but if this title
is placed in data
, it cannot be modified in this way.
Previous: The idea of correcting the writing method of database classification table
Next: How to distinguish between Chinese and English commas in js regular expressions
I use wx.openLocation to adjust the map directly. The green button in the lower right corner of the iPhone allows me to choose the route, but there is no route option on Android. Why? ...
is it true that calling wx.openLocation, directly won t pop up the authorization box? I tried three phones but didn t play. Why does the official document say that authorization is needed? ...
I read the official document that this API has been adjusted, and there will be no authorization pop-up window using this API. Please use < button open-type= "getUserInfo " > < button > to guide the user to take the initiative to authorize the operati...
what my Mini Program needs is to help the backend get the unionid to get through the official account and Mini Program. I get the login status and maintain the login. ...
I want to write a public function that gets the location of the user. I currently write that the data of return is not assigned a value because of asynchronous requests, so printing locationData should be undefined. Would like to ask the gods how to wri...
for example, when my md5 encryption js is placed in the utils folder, and the js of the page needs to be introduced into md5, what is the difference between using require introduction and import introduction? I think the official document says to use req...
there is no adaptive picture height in Mini Program writes a goodsList component. According to the return situation of the background, there are two formats: video and image. goodsList.wxml <view class= goods-container > <view class=...
there is no adaptive picture height in Mini Program writes a goodsList component. According to the return situation of the background, there are two formats: video and image. goodsList.wxml <view class= goods-container > <view class=...
as shown in the figure, binding in conditional rendering is a global variable in app.js, which means login status, but conditional rendering does not work after successful login, which makes me confused . ...