vue-a11y / vue-axe-next Goto Github PK
View Code? Open in Web Editor NEWAccessibility auditing for Vue.js 3 applications using axe-core
Home Page: https://vue-axe-next.surge.sh/
License: MIT License
Accessibility auditing for Vue.js 3 applications using axe-core
Home Page: https://vue-axe-next.surge.sh/
License: MIT License
Figuring out how to conditionally load vue-axe was a bit tricky, but here's a working example for others who might want to use it on a typescrpt project. It's important to note that if you import VueAxe outside the if development conditional, it'll be added to vendors.js in production (it's huge).
let app = null;
const setupApp = (app: any) => {
mountWidgets(app, i18n);
app.use(store);
app.use(router);
app.use(i18n);
app.mount('#app');
};
if (process.env.NODE_ENV === 'development') {
import('vue-axe').then((res) =>{
const VueAxe = res.default;
const VueAxePopup = res.VueAxePopup;
app = createApp({
render: () => h(Fragment, [h(App), h(VueAxePopup)]),
});
app.use(VueAxe);
setupApp(app);
});
} else {
app = createApp(App);
setupApp(app);
}
Hello is this compatible with Nuxt 3?
I tried to create a nuxt plugin like this, but without results:
import { defineNuxtPlugin } from "#app";
export default defineNuxtPlugin(async (nuxtApp) => {
if (process.env.NODE_ENV === "development") {
const VueAxe = await import("vue-axe");
nuxtApp.vueApp.use(VueAxe.default);
}
});
Happy New Year!
Vue is throwing a warning "Invalid vnode type when creating vnode: undefined at " when installing vue-axe@next in Vue 3. I do not see the popup that is supposed to show up on the bottom-right-corner of the screen.
I managed to reproduce the error here: https://codesandbox.io/s/vue-axe-next-error-lz5g2
Many thanks!
Hi folks, thanks for trying to support vue3.
I have tried to use it on my demo app for a meetup.
Iโm currently facing an issue while trying to use the lib. I got this error message :
webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:159 [Vue warn]: A plugin must either be a function or an object with an "install" function.
warn @ webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:159
webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:159 [Vue warn]: injection "Symbol(vue-axe)" not found.
at <Popup>
at <App>
warn @ webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:159
webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:159 [Vue warn]: Unhandled error during execution of setup function
at <Popup>
at <App>
warn @ webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:159
webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:338 Uncaught TypeError: Cannot read property 'results' of undefined
at setup (webpack-internal:///./node_modules/vue-axe/dist/vue-axe.esm.js:3193)
at callWithErrorHandling (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:275)
at setupStatefulComponent (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:6518)
at setupComponent (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:6479)
at mountComponent (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:4219)
at processComponent (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:4195)
at patch (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:3822)
at mountChildren (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:3995)
at processFragment (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:4155)
at patch (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:3815)
Please find the repo here to reproduce : https://github.com/Zenika/grenoble-hands-on-vuejs/tree/tests-a11y
Hello,
I have a use case where I should check only some specific elements, for example the element with the #header ID, along with all of its content. I would like to be able to customise the selector for the check so vue-axe only analyses my specific components.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.