
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
@3yourmind/vue-hooks
Advanced tools
⚡️ Awesome Vue Hooks
Using @vue/composition-api
to implement useful vue hooks.
Vue 3.0 has not been released yet, it allows you to use functional-based components in advance.
⚠️ 2.x has been switched to @vue/composition-api
, if you are using version 1.x please use vue-function-api
yarn add @vue/composition-api @u3u/vue-hooks
Docs are available at https://vue-hooks.netlify.com
import Vue from 'vue';
import VueCompositionAPI from '@vue/composition-api';
import hooks from '@u3u/vue-hooks';
Vue.use(hooks);
Vue.use(VueCompositionAPI); // Don't forget to use the plugin!
import { createComponent } from '@vue/composition-api';
import { useWindowSize } from '@u3u/vue-hooks';
export default createComponent({
setup() {
const { width, height, widthPixel, heightPixel } = useWindowSize();
return { width, height, widthPixel, heightPixel };
},
render() {
const { width, height, widthPixel, heightPixel } = this;
return (
<div id="app" style={{ width: widthPixel, height: heightPixel }}>
dynamic window size: {width}, {height}
</div>
);
},
});
useWindowSize
— Tracks window
dimensions.useCounter
— Tracks state of a number.usePrevious
— Returns the previous state or props.useRouter
— A hook for vue-router
.useStore
— A hook for vuex
.useState
— A hook for mapState
.useGetters
— A hook for mapGetters
.useMutations
— A hook for mapMutations
.useActions
— A hook for mapActions
.git checkout -b feat/new-hook
git commit -am 'feat(hooks): add a new hook'
git push origin feat/new-hook
Thanks goes to these wonderful people (emoji key):
u3u 💻 📖 💡 ⚠️ |
This project follows the all-contributors specification. Contributions of any kind are welcome!
FAQs
⚡️ Awesome Vue Hooks
The npm package @3yourmind/vue-hooks receives a total of 0 weekly downloads. As such, @3yourmind/vue-hooks popularity was classified as not popular.
We found that @3yourmind/vue-hooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers 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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.