原创 umi3 useRequest 配置

1,在app.ts中寫入: import { RequestConfig } from 'umi'; import config from "@/config" import errorHandler from "@/util/err

原创 安卓spinner的使用

 1,xml: <Spinner android:id="@+id/spinner" android:layout_width="wrap_content" and

原创 umi3優化配置,去掉log,開啓文件gzip壓縮

開啓gzip壓縮 1,安裝gzip的webpack插件 yarn add compression-webpack-plugin 2,在umirc.ts中寫入如下配置 //引入 const CompressionPlugin =

原创 ant Design Vue 表格右鍵

1,在表格外面添加menu組件 <a-menu class="menustyle" :style="menuStyle" v-if="menuVisible"> <a-menu-item> <a @click

原创 使用安卓intent來打電話,發短信,瀏覽網頁

intent 官網說明:https://developer.android.com/guide/components/intents-filters 1,跳轉頁面 Intent intent = new Intent();

原创 vue 調用父頁面方法

1,使用$parent方法 //在父組件中 data(){ return{ a:1 } } //在子組件中 this.$parent.a++ 2,使用 依賴注入 (推薦使用) //父組件 export

原创 recyclerview 上拉加載更多

// 上拉加載更多 recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override

原创 react redux 訂閱模式報錯解決方法

1,錯誤原因 //訂閱模式 this.cancelSub = store.subscribe(() => { this.setState(store.getState()); }); 衆所周知redux 訂閱

原创 安卓創建新線程和更新ui線程

1,創建新線程 new Thread(new Runnable() { @Override public void run() {

原创 vue ant design 改變主題

1,引入依賴: npm i webpack-theme-color-replacer 2,新建一個webpack插件的js :webpack_theme_plugin.js const ThemeColorReplacer = req

原创 安卓viewpager2通過fragment和tablayout使用

1,定義三個fragment頁面 2,頁面佈局如下   3,在父頁面中添加如下代碼: //給viewpager建立適配器 viewPager.setAdapter(new FragmentStateAdapter(thi

原创 viewModel與recyclerView結合

1,創建detailViewmodel package com.example.test10; import androidx.lifecycle.ViewModel; import java.util.ArrayList; imp

原创 安卓使用glide加載圖片

1,安卓加載圖片 自己寫的話是非常麻煩的,所以對於我們這種小白來說使用別人的開源庫就是最好的選擇: glide 官網地址:https://muyangmin.github.io/glide-docs-cn/ 2,引用 在build.gra

原创 vue 動態保存組件狀態 keep-alive

組件有時候需要保存狀態 1,使用keep-alive把組件包裹起來 <!-- 逗號分隔字符串 --> <keep-alive include="a,b"> <component :is="view"></component>

原创 vue-i18n 通過接口動態修改語言包

1,需求:需要通過後臺來接收語言包,並且實時修改掉 2,代碼: 直接通過setLocaleMessage的方法來動態修改 //html <h1>{{ $t("system.name") }}</h1> //js axios.