vue 自定义弹框的用法

vue 自定义弹框的用法
一、$prompt 的用法

  console.log('驳回的参数',list);
      this.$prompt('', '原因', {
        inputType: 'textarea',
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        inputPattern: /\S/,
        inputErrorMessage: '原因不能为空',
        inputValidator: (value) => {
          // 点击按钮时,对文本框里面的值进行验证
          if(!value) {
            return inputErrorMessage;
          }
        }
      }).then(({ value }) => {
        console.log('输入框的值',value);
      }).catch(() => {

      })

二、$confirm 的用法

 this.$confirm(`此操作将归为失败, 是否继续?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        // do
      }).catch(() => {

      })
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要自定义 ArcGIS API for JavaScript 中的 Vue 框样式,您需要使用自定义 CSS 样式表。以下是一个简单的例子: 1. 在您的 Vue 组件中,添加以下代码: ```html <template> <div> <div ref="popupContainer"></div> </div> </template> <script> import { loadModules } from 'esri-loader'; export default { name: 'MyMap', data() { return { view: null, popup: null } }, mounted() { this.initializeMap(); }, methods: { async initializeMap() { const [Map, MapView, Popup] = await loadModules(['esri/Map', 'esri/views/MapView', 'esri/widgets/Popup']); this.view = new MapView({ container: 'map', map: new Map({ basemap: 'streets-navigation-vector' }) }); this.popup = new Popup({ container: this.$refs.popupContainer, content: 'This is a test popup' }); this.view.popup = this.popup; } } } </script> <style> /* Customize the popup style here */ .esri-popup__main-container { border-radius: 10px; box-shadow: rgba(0, 0, 0, 0.3) 0px 2px 4px; background-color: #fff; color: #333; font-size: 14px; } </style> ``` 2. 在上面的代码中,我们使用了 `loadModules` 方法来加载 `esri/widgets/Popup` 模块,并在 `mounted` 钩子函数中初始化了框。我们在 `popup` 对象中设置了 `container` 属性为 `this.$refs.popupContainer`,这是一个空的 `div` 元素,用于容纳框内容。 3. 最后,在样式表中,我们可以使用 CSS 选择器来选择框的不同部分,并添加自定义样式。在这个例子中,我们选择了 `.esri-popup__main-container` 类,添加了一些样式,如圆角和阴影。 请注意,这只是一个简单的例子,您可以根据您的需求自定义更多样式。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值