|
|
@ -68,12 +68,23 @@ const props = withDefaults(
|
|
|
|
|
|
|
|
|
|
|
|
const tagOptions = computed(() => {
|
|
|
|
const tagOptions = computed(() => {
|
|
|
|
let options: DropdownOption[] = [];
|
|
|
|
let options: DropdownOption[] = [];
|
|
|
|
if (props.tag.is_following == 0) {
|
|
|
|
if (props.tag.is_following === 0) {
|
|
|
|
options.push({
|
|
|
|
options.push({
|
|
|
|
label: '关注',
|
|
|
|
label: '关注',
|
|
|
|
key: 'follow',
|
|
|
|
key: 'follow',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (props.tag.is_top === 0) {
|
|
|
|
|
|
|
|
options.push({
|
|
|
|
|
|
|
|
label: '置顶',
|
|
|
|
|
|
|
|
key: 'stick',
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
options.push({
|
|
|
|
|
|
|
|
label: '取消置顶',
|
|
|
|
|
|
|
|
key: 'unstick',
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
options.push({
|
|
|
|
options.push({
|
|
|
|
label: '取消关注',
|
|
|
|
label: '取消关注',
|
|
|
|
key: 'unfollow',
|
|
|
|
key: 'unfollow',
|
|
|
@ -83,14 +94,24 @@ const tagOptions = computed(() => {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const handleTagAction = (
|
|
|
|
const handleTagAction = (
|
|
|
|
item: 'follow' | 'unfollow'
|
|
|
|
item: 'follow' | 'unfollow' | 'stick' | 'unstick'
|
|
|
|
) => {
|
|
|
|
) => {
|
|
|
|
switch (item) {
|
|
|
|
switch (item) {
|
|
|
|
case 'follow':
|
|
|
|
case 'follow':
|
|
|
|
window.$message.success(`关注话题 - ${props.tag.tag}`);
|
|
|
|
// TODO
|
|
|
|
|
|
|
|
window.$message.success(`关注成功`);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'unfollow':
|
|
|
|
case 'unfollow':
|
|
|
|
window.$message.success(`取消关注话题 - ${props.tag.tag}`);
|
|
|
|
// TODO
|
|
|
|
|
|
|
|
window.$message.success(`取消关注`);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'stick':
|
|
|
|
|
|
|
|
// TODO
|
|
|
|
|
|
|
|
window.$message.success(`置顶成功`);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'unstick':
|
|
|
|
|
|
|
|
// TODO
|
|
|
|
|
|
|
|
window.$message.success(`取消置顶`);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|