Skip to content

Commit

Permalink
feat: Correcciones
Browse files Browse the repository at this point in the history
  • Loading branch information
christopher-qc committed Jun 10, 2024
1 parent 65a50ef commit 1b3cddd
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 57 deletions.
101 changes: 64 additions & 37 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,69 @@
// http://eslint.org/docs/user-guide/configuring

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
browser: true,
},
extends: 'airbnb-base',
// required to lint *.vue files
plugins: [
'html'
],
// check if imports actually resolve
'settings': {
'import/resolver': {
'webpack': {
'config': 'build/webpack.base.conf.js'
}
}
},
// add your custom rules here
'rules': {
// don't require .vue extension when importing
'import/extensions': ['error', 'always', {
'js': 'never',
'vue': 'never'
}],
// allow optionalDependencies
"linebreak-style": 0,
'import/no-extraneous-dependencies': ['error', {
'optionalDependencies': ['test/unit/index.js']
}],
// allow debugger during development
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module',
},
env: {
browser: true,
},
extends: 'airbnb-base',
// required to lint *.vue files
plugins: ['html'],
// check if imports actually resolve
settings: {
'import/resolver': {
webpack: {
config: 'build/webpack.base.conf.js',
},
},
},
// add your custom rules here
rules: {
'comma-dangle': 'off',
'arrow-parens': ['off', 'off'], // Desactiva la regla o ajusta según tu preferencia
'import/no-extraneous-dependencies': 'off', // Desactiva la regla import/no-extraneous-dependencies
'no-mixed-operators': 'off', // Activar la regla no-mixed-operators
indent: 'off', // Indentación con tabs
'no-mixed-spaces-and-tabs': 'off', // Evitar mezcla de espacios y tabs
// 'indent': ['error', 'tab'], // Indentación con tabs
'max-len': [
'error',
{
code: 120,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreComments: true, // Ignorar longitud de línea en comentarios largos
ignoreUrls: true, // Ignorar longitud de línea en URLs largas
ignoreRegExpLiterals: true, // Ignorar longitud de línea en expresiones regulares largas
ignorePattern: '^[ \t]*<(\\w+)([^>]*)>(.|\n)*?<\\/\\1>', // Ignorar líneas dentro de JSX
ignorePattern: '^\\s*\\{', // Ignorar líneas dentro de objetos de configuración largos
},
],
// don't require .vue extension when importing
'import/extensions': [
'error',
'always',
{
js: 'never',
vue: 'never',
},
],
// allow optionalDependencies
'import/no-extraneous-dependencies': [
'error',
{
optionalDependencies: ['test/unit/index.js'],
},
],
'linebreak-style': ['error', 'windows'],
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'no-tabs': 0,
'indent': ['error', 'tab']
}
}
// 'indent': 'off',
// 'no-mixed-spaces-and-tabs': 'off',
'linebreak-style': 0,
},
};
33 changes: 18 additions & 15 deletions src/components/products/product-in-car.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,26 +167,29 @@ function showComments() {
function inputQuantity(value) {
this.product.quantity = Number(value);
this.clickQuantity();
}
function clickQuantity(val) {
let { quantity } = this.product;
const { unit } = this.product;
if (this.product.category.type === 2) {
this.opt = {
more: 0.1,
less: -0.1,
};
quantity += this.opt[val];
quantity = +quantity.toFixed(2);
quantity = quantity < 0.1 ? 0.1 : quantity;
} else {
this.opt = {
more: 1,
less: -1,
};
quantity += this.opt[val];
quantity = quantity < 1 ? 1 : quantity;
if (val) {
if (this.product.id === 3581799) {
this.opt = {
more: 0.1,
less: -0.1,
};
quantity += this.opt[val];
quantity = +quantity.toFixed(2);
quantity = quantity < 0.1 ? 0.1 : quantity;
} else {
this.opt = {
more: 1,
less: -1,
};
quantity += this.opt[val];
quantity = quantity < 1 ? 1 : quantity;
}
}
this.quantityStock = parseInt(unit.quantity * quantity, 10);
if (this.showUnity) {
Expand Down
13 changes: 8 additions & 5 deletions src/components/shared/buttons/quantity-button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
v-if="product.category.type === 2"
class="input-number"
type="number"
:value="number"
v-model="number"
@input="$emit('input', $event.target.value )"
></input>
<div
Expand Down Expand Up @@ -78,10 +78,13 @@ export default {
button:hover {
background-color: color(border);
}
}
.input-number {
width: 50px;
text-align: center;
.input-number {
width: 50px;
text-align: center;
border-left: 1px solid color(base);
border-right: 1px solid color(base);
font-family: font(heavy);
}
}
</style>

0 comments on commit 1b3cddd

Please sign in to comment.