How to disable eslint rule max line length for paragraph in <template> of vue.js?
For eslint-plugin-vue
>= 4.1.0
you can use directive comments to disable eslint.
https://github.com/vuejs/eslint-plugin-vue/commit/ad84e0ba6d81f24583e65fc70b1d9803d73d3ed9
<template>
<!-- eslint-disable-next-line vue/max-attributes-per-line -->
<div a="1" b="2" c="3" d="4">
</div>
</template>
es lint max length rule disabling is not working
Not sure, your method should be working but can you give this a try by wrapping it?
/* eslint-disable max-len */
export const URI_REGEX = "" // something which is very long
/* eslint-enable max-len */
How to meet eslint max line length rules with long svg path?
"max-len": ["error", {"ignoreTemplateLiterals": true, "ignoreStrings": true}]
or
ESLint-plugin-React
How to disable rule [plugin:vite:vue] Duplicate attribute
In vue.js
, you can't have two v-bind
for the same attributes on one element.
In your case you are putting twice the classes
elements wich results in the Duplicate attribute.
error.
To solve your problem, I would recommand mergind your classes attributes using a computed
properties with the other classes you are trying to add.
export default {
computed: {
mergedClasses(){
return {...this.classes,
'bg-gray-100': disabled,
'cursor-not-allowed': disabled,
'inline-block': block,
'w-full': block,
}
}
}
}
And use it in the template :
<button
:id="id"
:type="type"
@click="onClick"
:class="mergedClasses"
:class="{
'bg-gray-100': disabled,
'cursor-not-allowed': disabled,
'inline-block': block,
'w-full': block,
}"
:disabled="disabled">{{ text }}<slot/></button>
Related Topics
Increase Counter Value Upon Button Click
How to Write an Onclick Function for a Dynamically Generated Button
How to Get the Contextpath from Javascript, the Right Way
Combine Multiple JavaScript Files into One Js File
Possible to Detect If a User Has Multiple Tabs of Your Site Open
Filter Input Text to Enter Only Number and Not Even Decimal
Ng2-Smart-Table Bind 'Add New' Button Event to an External Button
Alphanumeric, Dash and Underscore But No Spaces Regular Expression Check JavaScript
How to Wait Until All JavaScript Files Are Loaded Before Executing JavaScript Code
How to Push Array in Array in Angular
Why Flatlist Is Not Updating Dynamically in React Native
How to Access the Value of a Promise
How to Redirect Url After Login Successful Via Ajax Call in PHP
Disable Click Outside of Bootstrap Modal Area to Close Modal
Angular 4 | Window.Scrollto(); Is Not Working Properly
How to Close Bootstrap 3 Dropdown When We Click Outside on a Tablet
How to Prevent iOS Keyboard from Pushing the View Off Screen With CSS or Js