如果我没记错的话,useState可以更换任何商店吗Pinia?鉴于这useState使得 ref 可在所有组件之间共享,我很难知道是否应该使用 store 或 useState ref。例如,假设我有一个currentUser (firstName, lastName, email)在页面加载时从远程 API 获取的数据。我应该将此信息存储在PiniauserStore 中还是存储在useState('currentUser')?
该主题的最佳实践是什么?
useState() 文档: https: //v3.nuxtjs.org/api/composables/use-state
Pinia 文档: https: //pinia.vuejs.org/core-concepts/
当我使用这个库时:
compile 'co.ronash.android:pushe-base:1.4.0'
Run Code Online (Sandbox Code Playgroud)
我在gradle中得到这个错误:
Failed to resolve: com.android.support:support-v4:26.0.2
Run Code Online (Sandbox Code Playgroud)
我无法解决它.
还有就是在那里库忽视的解决方案
'com.android.support:support-v4:26.0.2'从'co.ronash.android:pushe-base:1.4.0'?
因为我已经编译了一个较新版本的support-v4库.
我的所有依赖项代码都是gradle:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support:support-v4:26.+' //--> its ok and no problem
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'co.ronash.android:pushe-base:1.4.0' //--->this code is error Failed to resolve: com.android.support:support-v4:26.0.2
compile 'com.google.android.gms:play-services-gcm:11.0.4'
compile 'com.google.android.gms:play-services-location:11.0.4'
testCompile 'junit:junit:4.12'
}
Run Code Online (Sandbox Code Playgroud)