-
+
+
+ {{ item.name || guessNameFromUrl(item.url) }}
+
@@ -47,7 +56,7 @@
import {
PlusOutlined,
CloseOutlined,
- YoutubeOutlined
+ FileOutlined
} from '@ant-design/icons-vue';
import { ref } from 'vue';
import SelectData from './components/select-data.vue';
@@ -98,6 +107,16 @@
const onDeleteItem = (index: number) => {
emit('del', index);
};
+
+ const guessNameFromUrl = (url: string) => {
+ const cleanUrl = (url?.split('?')[0] ?? '').trim();
+ const last = cleanUrl.split('/').pop() || '';
+ try {
+ return decodeURIComponent(last) || url;
+ } catch {
+ return last || url;
+ }
+ };