# this 作用域说明整理

# 面板自定义js

提示

此js内的方法,this 都指向 src/components/frame/Panel/PanelCode/index.vue 组件
可调用的api

  1. search
  2. resize
  3. reset
  4. refresh
  5. this.$refs.btnListRef.refreshSlot() // 重置/刷新按钮插槽

# 块自定义js

提示

此js内的方法,this 都指向 src/components/frame/Panel/PanelBlock/index.vue 组件
可调用的api

  1. search
  2. resize
  3. reset
  4. refresh
  5. this.$refs.btnListRef.refreshSlot() // 重置/刷新按钮插槽

如果需要面板作用域的方法,则 this.panelScope

# 内容自定义js

提示

this 指向 src\components\frame\Panel\BlockContent\ContentItem.vue 组件的方法

  • button里面的click事件

可调用的api

  1. search
  2. resize
  3. reset
  4. refresh
  5. this.$refs.btnListRef.refreshSlot() // 重置/刷新按钮插槽

如果需要调用内容作用域的方法,则 this.$refs.contentItemRef.xxx()
如果需要块作用域的方法,则 this.blockScope
如果需要面板作用域的方法,则 this.panelScope

this 指向所在内容的作用域的组件方法

  • dataUrl
  • beforeRequest
  • afterRequest
  • getOptions
  • beforeRender

可调用的api(部分报表类型可能不存在一些api,需注意分辨)

  1. search
  2. resize
  3. reset
  4. refresh

如果需要调用ContentItem作用域的方法,则 this.$parent.xxx()
如果需要块作用域的方法,则 this.blockScope
如果需要面板作用域的方法,则 this.panelScope