![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
vue3-storage-secure
Advanced tools
Vue3 plugin for work with local storage, session storage and websql from Vue context, inspired by tarojs, vue-ls and secure-ls.
# install with yarn
yarn add vue3-storage-secure
# install with npm
npm install vue3-storage-secure
The main version Supports Vue 3.x only
Register
import Vue3Storage from "vue3-storage-secure";
const app = createApp(App);
// 1. app.use(Vue3Storage)
// 2. app.use(Vue3Storage, { namespace: "jarvis_" })
// namespace: 命名空间,secureKey: 加密盐值
app.use(Vue3Storage, { namespace: "jarvis_", secureKey: "246810" })
use Global ComponentCustomProperties this.$storage
<template>
<div class="home">
<img alt="Vue logo" src="../assets/logo.png" />
</div>
</template>
<script lang="ts">
import { Options, Vue } from "vue-class-component";
@Options({
components: {}
})
export default class Home extends Vue {
created() {
this.$storage.setStorageSync("test-key", "testdata");
}
}
</script>
You can still use it like this:
<template>
<div class="home">
<img alt="Vue logo" src="../assets/logo.png" />
</div>
</template>
<script lang="ts">
import { defineComponent } from "vue";
import { useStorage } from "vue3-storage-secure";
export default defineComponent({
setup() {
const storage = useStorage();
storage?.setStorageSync("test-key", "testdata22");
return {};
}
});
</script>
You can still use it like this:
<script lang="ts">
import { defineComponent } from "vue";
import { useStorage } from "vue3-storage-secure";
import { CallbackResult } from "vue3-storage-secure/dist/lib/types";
export default defineComponent({
setup() {
const storage = useStorage();
storage?.setStorage({
key: "test-key",
data: "testdata22",
success: (callback: CallbackResult) => {
console.log(callback.errMsg);
}
});
return {};
}
});
</script>
Use promise
<script lang="ts">
import { defineComponent } from "vue";
import { useStorage } from "vue3-storage-secure";
import { CallbackResult } from "vue3-storage-secure/dist/lib/types";
export default defineComponent({
setup() {
const storage = useStorage();
storage
?.setStorage({
key: "test-key",
data: "testdata22"
})
.then((successCallback: CallbackResult) => {
console.log(successCallback.errMsg);
})
.catch((failCallback: CallbackResult) => {
console.log(failCallback.errMsg);
});
const mKey = "mao";
const mValue = "yupeng";
console.log("set secure [" + mKey + "]:", mValue)
storage?.setSecureStorageSync(mKey, mValue, 20)
console.log("get secure key [" + mKey + "]:", storage?.getSecureStorageSync(mKey))
return {};
}
});
</script>
export interface StorageInterface {
/**
* Asynchronous storage
* @param option
*/
getStorage<T = any>(option: GetStorageOption<T>): Promise<GetStorageSuccessCallbackResult<T>>;
/**
* Synchronous storage
*
* @param key
*
*/
getStorageSync<T = any>(key: string): T | undefined;
getSecureStorageSync<T = any>(key: string): T | undefined;
/**
* Synchronously obtain the storage content of the corresponding key
*
* @param key
* @param data
* @param expire
*/
setStorageSync(key: string, data: any, expire?: number): void;
/**
* 同步设置加密的存储内容
* @param key 本地缓存中指定的 key
* @param data 需要存储的内容。只支持原生类型、Date、及能够通过`JSON.stringify`序列化的对象。
* @param expire 失效时间
*/
setSecureStorageSync(key: string, data: any, expire?: number): void;
/**
* Asynchronously obtain the storage content of the corresponding key
*
* @param option
*/
setStorage(option: SetStorageOption): Promise<CallbackResult>;
/**
* Determine whether the data has expired
* @param key
*/
isExpire(key: string): boolean;
/**
* Correspondingly obtained key name index
* @param index
*/
key(index: number): string | null;
/**
* Determine whether the key name exists
*
* @param key
*/
hasKey(key: string): boolean;
/**
* Asynchronously remove the specified key from the local cache
*
* @param option
*/
removeStorage(option: RemoveStorageOption): Promise<CallbackResult>;
/**
* Synchronously remove the specified key from the local cache
*
* @param name
*/
removeStorageSync(name: string): void;
/**
* Get current storage information asynchronously
*
* @param option
*/
getStorageInfo(option?: GetStorageInfoSuccessCallbackOption): Promise<CallbackResult>;
/** Get current storage information synchronously */
getStorageInfoSync(): GetStorageInfoOption;
/**
* Clean up local data cache asynchronously
* @param option
*/
clearStorage(option?: ClearStorageOption): Promise<CallbackResult>;
/**
* Synchronously clean the local data cache
*/
clearStorageSync(): void;
/**
* Set storage namespace
* @param namespace
*/
config(namespace?: string): void;
}
MIT
FAQs
Vue3 plugin for work with local storage, session storage and websql from Vue context, inspired by tarojs, vue-ls and secure-ls.
The npm package vue3-storage-secure receives a total of 10 weekly downloads. As such, vue3-storage-secure popularity was classified as not popular.
We found that vue3-storage-secure demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.