2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-19 09:50:33 +03:00

improve RTL support

This commit is contained in:
Jeff
2017-10-01 16:20:34 -07:00
parent 2960029375
commit d9fd2fd36d
2 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -32,7 +32,7 @@
<body> <body>
<div id="app"> <div id="app">
<v-select placeholder="default" :options="options"></v-select> <v-select placeholder="default" :options="options"></v-select>
<v-select placeholder="default, RTL" :options="options" :rtl="true" dir="rtl"></v-select> <v-select placeholder="default, RTL" :options="options" dir="rtl"></v-select>
<v-select placeholder="multiple" multiple :options="options"></v-select> <v-select placeholder="multiple" multiple :options="options"></v-select>
<v-select placeholder="multiple, taggable" multiple taggable :options="options" no-drop></v-select> <v-select placeholder="multiple, taggable" multiple taggable :options="options" no-drop></v-select>
<v-select placeholder="multiple, taggable, push-tags" multiple push-tags taggable :options="[{label: 'Foo', value: 'foo'}]"></v-select> <v-select placeholder="multiple, taggable, push-tags" multiple push-tags taggable :options="[{label: 'Foo', value: 'foo'}]"></v-select>
+9 -7
View File
@@ -283,7 +283,7 @@
</style> </style>
<template> <template>
<div class="dropdown v-select" :class="dropdownClasses"> <div :dir="dir" class="dropdown v-select" :class="dropdownClasses">
<div ref="toggle" @mousedown.prevent="toggleDropdown" :class="['dropdown-toggle', 'clearfix', {'disabled': disabled}]"> <div ref="toggle" @mousedown.prevent="toggleDropdown" :class="['dropdown-toggle', 'clearfix', {'disabled': disabled}]">
<span class="selected-tag" v-for="option in valueAsArray" v-bind:key="option.index"> <span class="selected-tag" v-for="option in valueAsArray" v-bind:key="option.index">
@@ -551,12 +551,14 @@
}, },
/** /**
* Sets Rtl support. * Sets RTL support. Accepts 'ltr', 'rtl', 'auto'.
* @type {Boolean} * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir
* @type {String}
* @default 'auto'
*/ */
rtl: { dir: {
type: Boolean, type: String,
default: false default: 'auto'
}, },
}, },
@@ -839,7 +841,7 @@
searchable: this.searchable, searchable: this.searchable,
unsearchable: !this.searchable, unsearchable: !this.searchable,
loading: this.mutableLoading, loading: this.mutableLoading,
rtl: this.rtl rtl: this.dir === 'rtl'
} }
}, },