2024年9月26日 星期四

讓 div 也有 button 的 disabled 效果避免連續觸發click事件

.按鍵[disabled="true"] {
    opacity: 0.4;
    pointer-events: none;

<div class="按鍵" @click="aaa" :disabled="busy">click me</div>

※ 某些前端框架要改用 disabled="disabled"

2024年9月4日 星期三

vue router 學習心得

import router from '@/router/index';

index.ts
const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: 'home',
        component: () => import('../views/Index.vue'),
        meta: { requireAuth: true, title: 'sample app' }
    },

取得網址: process.env.BASE_URL+router.resolve({ name: 'xxx' }).href
導向網址: router.push({ name: 'xxx', query: {p1: 123} })

2024年7月8日 星期一

2024年6月22日 星期六

steam 遊戲語言改中文

方法1

開啟 steam_emu.ini
Language=tchinese

方法2

C:\Users\%username%\AppData\Roaming\Goldberg SteamEmu Saves\settings\language.txt
內容改為 tchinese

HDR 在艾爾登法環中呈灰色

出於某種原因,如果 Windows 在啟動 elden ring 之前為另一個真正的 HDR 遊戲打開 HDR,那麼就會發生這種情況。重新啟動PC,在HDR開啟的情況下啟動,應該可以修復它。

2024年5月17日 星期五

自訂權限驗證機制

// 使用 filter
[Route("api/[controller]")]
[ApiController]
[Authorize]
[TypeFilter(typeof(CustomAsyncAuthorizationFilter))]
public class Controller1 : ControllerBase

// 定義 filter
public sealed class CustomAsyncAuthorizationFilter : IAsyncAuthorizationFilter
{
    public async Task OnAuthorizationAsync(AuthorizationFilterContext context)
    {
        bool isAuthorized = await CheckUserAuthorizationAsync(context);
        if (!isAuthorized) context.Result = new ForbidResult();
    }
    private async Task<bool> CheckUserAuthorizationAsync(AuthorizationFilterContext context)
    {
       // do something and return bool
    }

開啟 edge 提升影片品質功能

 edge://flags/#edge-video-super-resolution