<template>
  <view class="item-list-simple-container">
    <template v-for="(item, index) in ds">
      <view class="list-item" :key="index" @click="onItemClick(item)">
        <view class="item-icon"
              :style="{
                 background: `url(${getImageUrl(ICON_CFG.theme_icon)}) no-repeat `,
                 backgroundSize: '100%',
               }"
        ></view>
        <view class="list-item-right">
          <view class="item-title">{{ item.title }}</view>
        </view>
      </view>
    </template>
  </view>
</template>

<script>
import { ICON_CFG } from '@/common/EnumConst';
import { getImageUrl } from '@/util';

export default {
  name: 'item-list-simple',
  computed: {
    ICON_CFG() {
      return ICON_CFG;
    },
  },
  props: {
    ds: {
      type: Array,
      default: () => [],
    },
    onItemClick: {
      type: Function,
      default: () => {},
    },
  },
  data() {
    return {};
  },
  created() {
    this.children = [];
  },
  onLoad() {
  },
  methods: { getImageUrl },
};
</script>
<style lang="scss" src="./index.scss" />
