Uniapp related notes

Unt Jump

uni.navigateTo(OBJECT)

Keep the current page, jump to a page in the app, and use uni.navigateBack to return to the original page.
OBJECT parameter description: The parameter type is required. The urlString is the path of the non-tabBar page in the application that needs to be redirected .
Parameters can be added after the path. Parameters and paths are separated by ?, parameter keys and parameter values ​​are connected by =, and different parameters are separated by &; the
tabBar page is not available

uni.navigateTo({
    
    
    url: 'test?id=1&name=uniapp'
});

uni.redirectTo(OBJECT)

Close the current page and jump to a page in the app.
OBJECT parameter description Parameter type is required. Description urlString is the path of the non-tabBar page in the application that needs to be redirected . Parameters can be added after the path. Parameters and paths are separated by ?, parameter keys and parameter values ​​are connected by =, and different parameters are separated by &; the tabBar page is not available

uni.redirectTo({
    
    
    url: 'test?id=1' // 传递参数 id,值为1
});

uni.reLaunch(OBJECT)

Close all pages and open to a page within the app. OBJECT parameter description: The parameter type is required. The urlString is the path of the page in the application that needs to be redirected. Parameters can be added after the path. Parameters and paths are separated by ?, parameter keys and parameter values ​​are connected by =, and different parameters are separated by &; the tabBar page is not available

uni.reLaunch({
    
    
    url: 'test?id=1'
});

uni.switchTab(OBJECT)

Jump to the tabBar page and close all other non-tabBar pages.
OBJECT parameter description: The parameter type is required to indicate that urlString is the path of the tabBar page that needs to be redirected (the page that needs to be defined in the tabBar field of app.json), and the path cannot be followed by parameters

Uview

Form form

Display required * characters: required="true"
Rules must be assigned in onReady

uFormRef.value.setRules(data.rules)

upload

To display uploaded pictures, you need to bind the fileList property

:file-list="sitePhotosList"

[Format as follows]{.underline}

  fileList: [{
    
    
  url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg',
  error: false,
  progress: 100
}],

Error report

insert image description here

Solution:
Solution 1:
locate the corresponding file
insert image description here
and modify this sentence to:

[v: string]: string | number | undefined

Solution 2:
— Mainly because the version of vue is too high, check the version of vue is [email protected], you need a lower version of vue to package successfully

– Solution:
1. npm install [email protected] or npm install [email protected] --legacy-peer-deps
2. npm install [email protected] or npm install vue-template-compiler@ 2.6.14 --legacy-peer-deps

Guess you like

Origin blog.csdn.net/Ndbsa/article/details/128161128