Skip to content

Commit

Permalink
Fix: checkElTable 判定条件放开
Browse files Browse the repository at this point in the history
  • Loading branch information
Lruihao committed Sep 25, 2023
1 parent 32fb507 commit 2340ae5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cell-x/el-table-sticky",
"version": "1.0.0-RC.1",
"version": "1.0.0-RC.2",
"description": "A set of directives for element-ui el-table to make table header, footer and horizontal scrollbar sticky.",
"keywords": [
"vue",
Expand Down
5 changes: 4 additions & 1 deletion src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export function convertToPx(value) {
* @param {Object} vnode vnode
*/
export function checkElTable(binding, vnode) {
if (vnode?.componentOptions?.tag !== 'el-table') {
if (
vnode?.componentOptions?.tag !== 'el-table' ||
!vnode.elm.classList.contains('el-table')
) {
throw new Error(`v-${binding.name} directive can only be used on el-table, but got ${vnode?.componentOptions?.tag}.`)
}
}

0 comments on commit 2340ae5

Please sign in to comment.